package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by WHH-PC on 2018/1/9.
 */
@Entity
@Table(name = "T_SYS_LEAVE", schema = "oa", catalog = "")
public class LeaveEntity extends BaseEntity {
    //用户Id
    private String userId;

    //请假开始时间
    private Date beginTime;

    //请假结束时间
    private Date endTime;

    //请假事由
    private String remark;

    //创建人
    private String createUserId;

    private String leaveDate;

    //上午
    private Double am;

    //下午
    private Double pm;

    private String companyId;



    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }


    public String getLeaveDate() {
        return leaveDate;
    }

    public void setLeaveDate(String leaveDate) {
        this.leaveDate = leaveDate;
    }

    public Double getAm() {
        return am;
    }

    public void setAm(Double am) {
        this.am = am;
    }

    public Double getPm() {
        return pm;
    }

    public void setPm(Double pm) {
        this.pm = pm;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("USER_ID", getUserId());
        obj.put("BEGIN_TIME", getBeginTime());
        obj.put("END_TIME", getEndTime());
        obj.put("REMARK", getRemark());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("LEAVE_DATE", getLeaveDate());
        obj.put("AM", getAm());
        obj.put("PM", getPm());
        obj.put("COMPANY_ID", getCompanyId());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_LEAVE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("USER_ID", "userId");
        obj.put("BEGIN_TIME", "beginTime");
        obj.put("END_TIME", "endTime");
        obj.put("REMARK", "remark");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("LEAVE_DATE", "leaveDate");
        obj.put("AM", "am");
        obj.put("PM", "pm");
        obj.put("COMPANY_ID", "companyId");
        return obj;
    }
}
